//
//package com.oa.ht.ctrl;
//
//import java.util.Date;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.mdp.core.entity.Result;
//import com.mdp.core.err.BizException;
//import com.mdp.core.query.QueryTools;
//import com.mdp.safe.client.entity.User;
//import com.mdp.safe.client.utils.LoginUtils;
////import org.apache.commons.lang3.StringUtils;
//import com.mdp.swagger.ApiEntityParams;
//import com.oa.ht.entity.ContractPaymentInvoice;
//import org.springframework.util.StringUtils;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiResponse;
//import io.swagger.annotations.ApiResponses;
//import com.mdp.mybatis.PageUtils;
//import com.mdp.core.utils.RequestUtils;
//import com.mdp.core.entity.Tips;
//import com.oa.ht.service.ContractPaymentRequireService;
//import com.oa.ht.entity.ContractPaymentRequire;
//
///**
// * url编制采用rest风格,如对OA.ht_contract_payment_require ht_contract_payment_require的操作有增删改查,对应的url分别为:<br>
// * 新增: ht/contractPaymentRequire/add <br>
// * 查询: ht/contractPaymentRequire/list<br>
// * 模糊查询: ht/contractPaymentRequire/listKey<br>
// * 修改: ht/contractPaymentRequire/edit <br>
// * 删除: ht/contractPaymentRequire/del<br>
// * 批量删除: ht/contractPaymentRequire/batchDel<br>
// * 组织 com.qqkj  顶级模块 oa 大模块 ht 小模块 <br>
// * 实体 ContractPaymentRequire 表 OA.ht_contract_payment_require 当前主键(包括多主键): id;
// ***/
//@RestController("oa.ht.contractPaymentRequireController")
//@RequestMapping(value = "/**/ht/contractPaymentRequire")
//@Api(tags = {"ht_contract_payment_require操作接口"})
//public class ContractPaymentRequireController {
//
//    static Log logger = LogFactory.getLog(ContractPaymentRequireController.class);
//
//    @Autowired
//    private ContractPaymentRequireService contractPaymentRequireService;
//
//    @ApiOperation(value = "查询ht_contract_payment_require信息列表", notes = "listContractPaymentRequire,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}")
//    @ApiEntityParams(ContractPaymentRequire.class)
//    @ApiResponses({@ApiResponse(code = 200, response = ContractPaymentRequire.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},pageInfo:{total:总记录数},data:[数据对象1,数据对象2,...]}")})
//    @RequestMapping(value = "/list", method = RequestMethod.GET)
//    public Result listContractPaymentRequire(@RequestParam Map<String, Object> contractPaymentRequire) {
//        Map<String, Object> m = new HashMap<>();
//        RequestUtils.transformArray(contractPaymentRequire, "ids");
//        QueryWrapper<ContractPaymentRequire> qw = QueryTools.initQueryWrapper(ContractPaymentRequire.class, contractPaymentRequire);
//        IPage page = QueryTools.initPage(contractPaymentRequire);
//        List<Map<String, Object>> contractPaymentRequireList = contractPaymentRequireService.selectListMapByWhere(contractPaymentRequire);    //列出ContractPaymentRequire列表
//        return Result.ok("query-ok", "查询成功").setData(contractPaymentRequireList).setTotal(page.getTotal());
//    }
//
//
//    @ApiOperation(value = "新增一条ht_contract_payment_require信息", notes = "addContractPaymentRequire,主键如果为空，后台自动生成")
//    @ApiResponses({@ApiResponse(code = 200, response = ContractPaymentRequire.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}")})
//    @RequestMapping(value = "/add", method = RequestMethod.POST)
//    public Map<String, Object> addContractPaymentRequire(@RequestBody ContractPaymentRequire contractPaymentRequire) {
//        Map<String, Object> m = new HashMap<>();
//        Tips tips = new Tips("成功新增一条数据");
//        
//            if (StringUtils.isEmpty(contractPaymentRequire.getId())) {
//                contractPaymentRequire.setId(contractPaymentRequireService.createKey("id"));
//            } else {
//                ContractPaymentRequire contractPaymentRequireQuery = new ContractPaymentRequire(contractPaymentRequire.getId());
//                if (contractPaymentRequireService.countByWhere(contractPaymentRequireQuery) > 0) {
//                    tips.setFailureMsg("编号重复，请修改编号再提交");
//                    m.put("tips", tips);
//                    return m;
//                }
//            }
//            User user = LoginUtils.getCurrentUserInfo();
//            contractPaymentRequire.setCreateUserId(user.getUserid());
//            contractPaymentRequire.setCreateUserName(user.getUsername());
//            contractPaymentRequire.setCreateDate(new Date());
//            contractPaymentRequire.setBranchId(user.getBranchId());
//            contractPaymentRequireService.insert(contractPaymentRequire);
//            m.put("data", contractPaymentRequire);
//        
//        m.put("tips", tips);
//        return m;
//    }
//
//    /**
//     @ApiOperation( value = "删除一条ht_contract_payment_require信息",notes="delContractPaymentRequire,仅需要上传主键字段")
//     @ApiResponses({
//     @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}")
//     })
//     @RequestMapping(value="/del",method=RequestMethod.POST) public Map<String,Object> delContractPaymentRequire(@RequestBody ContractPaymentRequire contractPaymentRequire){
//     Map<String,Object> m = new HashMap<>();
//     Tips tips=new Tips("成功删除一条数据");
//     
//     contractPaymentRequireService.deleteByPk(contractPaymentRequire);
//     
//     m.put("tips", tips);
//     return m;
//     }
//     */
//
//    /**
//     @ApiOperation( value = "根据主键修改一条ht_contract_payment_require信息",notes="editContractPaymentRequire")
//     @ApiResponses({
//     @ApiResponse(code = 200,response=ContractPaymentRequire.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}")
//     })
//     @RequestMapping(value="/edit",method=RequestMethod.POST) public Map<String,Object> editContractPaymentRequire(@RequestBody ContractPaymentRequire contractPaymentRequire) {
//     Map<String,Object> m = new HashMap<>();
//     Tips tips=new Tips("成功更新一条数据");
//     
//     contractPaymentRequireService.updateByPk(contractPaymentRequire);
//     m.put("data",contractPaymentRequire);
//     
//     m.put("tips", tips);
//     return m;
//     }
//     */
//
//
//    /**
//     @ApiOperation( value = "根据主键列表批量删除ht_contract_payment_require信息",notes="batchDelContractPaymentRequire,仅需要上传主键字段")
//     @ApiResponses({
//     @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}")
//     })
//     @RequestMapping(value="/batchDel",method=RequestMethod.POST) public Map<String,Object> batchDelContractPaymentRequire(@RequestBody List<ContractPaymentRequire> contractPaymentRequires) {
//     Map<String,Object> m = new HashMap<>();
//     Tips tips=new Tips("成功删除"+contractPaymentRequires.size()+"条数据");
//     
//     contractPaymentRequireService.batchDelete(contractPaymentRequires);
//     
//     m.put("tips", tips);
//     return m;
//     }
//     */
//}
